/* 全局样式 */
.app {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* 头部样式 */
.header {
  text-align: center;
  padding: 2rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* 搜索框样式 */
.search-container {
  padding: 2rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 25px;
  padding: 0.75rem 1.5rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-icon {
  margin-right: 1rem;
  opacity: 0.7;
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: white;
  font-size: 1rem;
  padding: 0.5rem 0;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

/* 角色网格样式 */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 0 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.role-card {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.role-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.role-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  margin: 0 auto 1rem;
  color: white;
}

.role-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.role-card p {
  opacity: 0.9;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.role-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.skill-tag {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 无结果样式 */
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  opacity: 0.8;
}

/* 聊天头部样式 */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.back-button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.current-role {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.current-role .role-avatar {
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
}

.current-role h2 {
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
}

.current-role p {
  font-size: 0.9rem;
  opacity: 0.8;
}

.skills-button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.skills-button:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 技能面板样式 */
.skills-panel {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1rem 2rem;
}

.skills-panel h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.skills-grid button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.skills-grid button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* 聊天容器样式 */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
}

.message.assistant .message-avatar {
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
}

.message-content {
  background: rgba(255, 255, 255, 0.15);
  padding: 1rem 1.25rem;
  border-radius: 20px;
  max-width: 70%;
  line-height: 1.5;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.message.user .message-content {
  background: rgba(78, 205, 196, 0.3);
  border: 1px solid rgba(78, 205, 196, 0.4);
}

/* 加载动画 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.typing-indicator {
  display: flex;
  gap: 4px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 输入框样式 */
.input-container {
  padding: 1rem 0 2rem;
}

.input-box {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 25px;
  padding: 1rem 1.25rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.input-box textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: white;
  font-size: 1rem;
  resize: none;
  max-height: 120px;
  font-family: inherit;
}

.input-box textarea::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.input-actions {
  display: flex;
  gap: 0.5rem;
}

.voice-button, .send-button {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.voice-button {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.voice-button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.voice-button.listening {
  background: #ff6b6b;
  animation: pulse 1.5s infinite;
}

.send-button {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  color: white;
}

.send-button:hover:not(:disabled) {
  background: linear-gradient(45deg, #44a08d, #4ecdc4);
  transform: scale(1.05);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
  }
}

/* 图标样式 */
.icon {
  width: 18px;
  height: 18px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }
  
  .roles-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem 2rem;
  }
  
  .chat-header {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .current-role {
    justify-content: center;
  }
  
  .message-content {
    max-width: 85%;
  }
  
  .input-box {
    padding: 0.75rem 1rem;
  }
  
  .voice-button, .send-button {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 1.5rem 1rem;
  }
  
  .header h1 {
    font-size: 1.8rem;
  }
  
  .role-card {
    padding: 1.5rem;
  }
  
  .role-avatar {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  
  .message-content {
    max-width: 90%;
    padding: 0.75rem 1rem;
  }
}

